﻿Option Explicit On
Option Strict On

Imports System
Imports System.Security.Permissions
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Security
Imports Microsoft.SharePoint.Utilities
Imports Microsoft.SharePoint.Workflow

Public Class PageChangedEventReceiver
    Inherits SPItemEventReceiver

    ''' <summary>
    ''' An item was updated.
    ''' </summary>
    Public Overrides Sub ItemUpdated(ByVal properties As SPItemEventProperties)
        MyBase.ItemUpdated(properties)
        If properties.ListItem.ModerationInformation.Status = SPModerationStatusType.Approved Then
            Dim smb As New BuilderMain(properties.SiteId)
            smb.Run()
        End If


    End Sub

    ''' <summary>
    ''' A file was moved.
    ''' </summary>
    Public Overrides Sub ItemFileMoved(ByVal properties As SPItemEventProperties)
        MyBase.ItemUpdated(properties)
        If properties.ListItem.ModerationInformation.Status = SPModerationStatusType.Approved Then
            Dim smb As New BuilderMain(properties.SiteId)
            smb.Run()
        End If
    End Sub


End Class
